/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package drt;

import java.util.Map;
import logic.Type;

/**
 *
 * @author phong
 */
public class DRSPossibilityCondition extends DRSUnaryComplexCondition {
    
    public DRSPossibilityCondition(DrtExpression term) {
        super(term);
    }
    
    @Override
    public Type getType() {
        return Type.TRUTH_TYPE;
    }
    
    /*
     * we do not solve the double negated DRS
     * (it is not true that -(-DRS) = DRS
     */
    @Override
    public DRSPossibilityCondition simplify() {
        return new DRSPossibilityCondition(this.term.simplify());
    }
    
    @Override
    public DRSPossibilityCondition replace(DrtVariable var, DrtExpression exp) {
        return new DRSPossibilityCondition(this.term.replace(var, exp));
    }
    
    @Override
    public String toString() {
        return "POS" + this.term.toString();
    }
    
    @Override
    public boolean equals(Object other) {
        if (other instanceof DRSPossibilityCondition) {
            return this.term.equals(((DRSPossibilityCondition)other).term);
        }
        return false;
    }    

    @Override
    public DRSPossibilityCondition getTemplate(Map<String,String> map) {
        DrtExpression newTerm = this.term.getTemplate(map);
        return new DRSPossibilityCondition(newTerm);
    }
}
